<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Editar Usuário</h2>

            <p:panel styleClass="container_24 clearfix " style="background: none; border: none;"> 
                <h:form id="form" acceptcharset="utf-8">
                    <p:growl id="msg" life="3000" autoUpdate="true"/>

                    <p class="subtitle">Dados Gerais</p>

                    <p:outputLabel value="Nome : " styleClass="grid_3"/>
                    <p:inputText  styleClass="grid_18" value="#{managerPesquisarUsuario.usuarioEditar.nome}"/>

                    <p:outputLabel value="Curso:" styleClass="grid_3" for="cursoSelectCheckboxMenu" />
                    <div class="grid_8">
                        <p:selectOneMenu id="cursoSelectCheckboxMenu"
                                         value="#{managerPesquisarUsuario.curso}" 
                                         label="Selecione o curso" filter="true"
                                         filterMatchMode="contains"
                                         required="true"
                                         converter="cursoconverter"
                                         caseSensitive="false" panelStyle="width:220px">
                            <f:selectItem itemLabel="" itemValue="" />
                            <f:selectItems value="#{managerPesquisarUsuario.cursos}" var="item" 
                                           itemLabel="#{item.codigo.concat(' - ').concat(item.nome)}" itemValue="#{item}" />  
                        </p:selectOneMenu>
                    </div>
                    <div class="clear" /><br/>

                    <p class="subtitle">Administração</p>
                    <br/> 

                    <p:outputLabel value="Acesso : " styleClass="grid_3"/>
                    <p:selectCheckboxMenu value="#{managerPesquisarUsuario.grupoSelecionado}" styleClass="grid_10" 
                                          converter="grupoconverter" label="Nível de Acesso" >  
                        <f:selectItems value="#{managerPesquisarUsuario.grupos}" var="g" itemValue="#{g}" />  
                    </p:selectCheckboxMenu>




                    <br/>
                    <div class="buttonAction">
                        <p:commandButton value="Atualizar" actionListener="#{managerPesquisarUsuario.atualizar()}"
                                         icon="ui-icon-disk" styleClass="ui-priority-primary"
                                         update="@form"  />
                        <p:button value="Cancelar" icon="ui-icon-circle-close"
                                  href="pesquisarusuario.xhtml"
                                  />
                    </div>






                </h:form>


            </p:panel> 
        </ui:define>
    </ui:composition>
</html>